import logging as log


def jianfeng_ci(influxdb_clinet, dt_start, dt_end):
    # 导入文件
    sql = """
        SELECT value FROM "CG_LT_GL_GL04_1HTCXJZSD" WHERE time >='{}' AND  time <='{}'
    """.format(dt_start, dt_end)
    log.info("jianfeng_ci sql {}".format(sql))
    result_set = list(influxdb_clinet.query(sql))

    count = 0
    if len(result_set) > 0:
        result_list = result_set[0]
        index = 0
        for index,result in enumerate(result_list):
            if index == 0:continue
            result_prev = result_list[index - 1]
            if result['value'] - result_prev['value'] >= 150:
                count = count + 1
        return count
    return 0
